package pro.lepers.portfolio.view.contents.portfolio.misc {
	import fr.digitas.flowearth.event.NumberEvent;

	import flash.display.Sprite;
	import flash.events.Event;

	/**
	 * @author plepers
	 */
	public class VideoControl extends Sprite {
		public static const START_SEEK : String = "START_SEEK";
		public static const STOP_SEEK : String = "STOP_SEEK";
		public static const SEEK : String = "SEEK";

		public var seekBar : SeekBar;
		
		public function VideoControl () {
			seekBar.addEventListener( VideoControl.START_SEEK, onStartSeek );
			seekBar.addEventListener( VideoControl.STOP_SEEK, onStopSeek );
			seekBar.addEventListener( VideoControl.SEEK, onSeek );
		}

		private function onStartSeek (event : Event) : void {
			_seek = true;
		}

		private function onStopSeek (event : Event) : void {
			_seek = false;
		}

		private function onSeek (event : NumberEvent) : void {
			dispatchEvent( event );
		}

		public function setSize ( w : int ) : void {
			seekBar.width = w;
		}
		
		private var _seek : Boolean = false;
		
		public function get seek () : Boolean {
			return _seek;
		}
	}
}
